package com.sansui.admin.core.model;

import java.io.Serializable;

import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sansui.admin.core.groups.UserAdd;
import com.sansui.admin.core.groups.UserUpdate;

import lombok.Data;

@Data
@Table(name = "name")
public class UserAddModel implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7484136779753770396L;
	@NotNull(groups = { UserUpdate.class }, message = "id不能为空")
	private String id;
	@NotNull(groups = { UserUpdate.class, UserAdd.class }, message = "username不能为空")
	private String username;
	@NotNull(groups = { UserUpdate.class, UserAdd.class }, message = "password不能为空")
	private String password;
	private String[] roleId;

	public UserAddModel(String id, String username, String password) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
	}

	public UserAddModel() {

	}

	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + "]";
	}

}